<?php
/**
 * @auther:周卫星
 * @date:2019/10/21
 * @fileName:admin.php
 * @fileDesc: 后台管理路由文件
 */

Route::group(['domain' => 'manage.sysdcw.com'], function (){
    Route::get('/login', ['as' => 'login', 'uses' => 'admin\LoginController@login']);
    Route::post('/doLogin', ['as' => 'doLogin', 'uses' => 'admin\LoginController@login']);

    Route::middleware(['adminLogin'])->group(function (){
        Route::get('/signout', ['as' => '/', 'uses' => 'admin\LoginController@signout']);
        Route::get('/', ['as' => '/', 'uses' => 'admin\IndexController@index']);
        Route::group(['prefix' => 'biz'], function (){
            Route::get('/', ['as' => '/', 'uses' => 'admin\BizController@index']);
            Route::get('/list', ['as' => 'list', 'uses' => 'admin\BizController@lists']);
            Route::get('/info/{id}', ['as' => 'info', 'uses' => 'admin\BizController@bizInfo']);
            Route::post('/update', ['as' => 'info', 'uses' => 'admin\BizController@updateBiz']);
            Route::get('/add', ['as' => 'add', 'uses' => 'admin\BizController@addBiz']);
            Route::post('/doAdd', ['as' => 'doAdd', 'uses' => 'admin\BizController@addBiz']);
            Route::get('/updateInfo/{id}', ['as' => 'updateInfo', 'uses' => 'admin\BizController@updateBizInfo']);
            Route::post('/updateInfoDo', ['as' => 'updateInfoDo', 'uses' => 'admin\BizController@updateBizInfo']);
        });
        Route::group(['prefix' => 'faq'], function (){
            Route::get('/', ['as' => '/', 'uses' => 'admin\FaqController@index']);
            Route::get('/add', ['as' => '/add', 'uses' => 'admin\FaqController@add']);
            Route::post('/add-do', ['as' => 'add-do', 'uses' => 'admin\FaqController@add']);
            Route::get('/edit/{id}', ['as' => '/edit', 'uses' => 'admin\FaqController@edit']);
            Route::post('/edit-do', ['as' => '/edit-do', 'uses' => 'admin\FaqController@edit']);
        });
        Route::post('/upload', ['as' => 'upload', 'uses' => 'common\UploadController@uploadImage']);
        Route::post('/upload-editor', ['as' => 'upload-editor', 'uses' => 'common\UploadController@uploadEditor']);
    });
});
